Skip to content

Unit Test Cleanup #1227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 29, 2025
Merged

Unit Test Cleanup #1227

merged 4 commits into from
Apr 29, 2025

Conversation

Brennan1994
Copy link
Collaborator

No description provided.

@Brennan1994 Brennan1994 marked this pull request as ready for review April 14, 2025 16:58
@Brennan1994 Brennan1994 requested a review from rnugent3 April 14, 2025 16:58
Copy link
Contributor

@rnugent3 rnugent3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. A couple questions to think about.

@@ -268,7 +268,7 @@ public void AnalyticalWithRegUnreg_ScenarioResults(double expectedResidentialMea
//Act
double actualResidentialMeanEAD = scenarioResults.MeanExpectedAnnualConsequences(impactAreaID1, residentialDamageCategory);
double actualCommercialMeanEAD = scenarioResults.MeanExpectedAnnualConsequences(impactAreaID1, commercialDamageCategory);
double tolerance = 0.19;
double tolerance = 0.2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we reconsider whether this test is helpful?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely. Where did the expected values come from?

@@ -256,32 +256,13 @@ private Inventory CreateInventory()
return inventory;
}


[Fact]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have a similar test somewhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not necessarily. Truth is this test hadn't been run in a long time, and the case it was testing throws an exception way before it looks like it did in this test. A lot of processing is kicked off right in the constructor of IASD. We might reconsider that, because constructors can't fail as gracefully as we can on other methods.

For now, this test just isn't useful, and should go.

public class StructureDataValidatorShould
{
static PointShapefile pointShapefile = new PointShapefile(Resources.StringResourcePaths.pathToNSIShapefile);
private static PointFeatureCollection pointShapefile = GetFeatures(Resources.StringResourcePaths.pathToNSIShapefile);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@Brennan1994
Copy link
Collaborator Author

Documented remaining comments in separate issues. Merging because the overall benefit of having these tests updated is necessary to keep the next release on schedule.

@Brennan1994 Brennan1994 merged commit ef19b9e into main Apr 29, 2025
1 check passed
@Brennan1994 Brennan1994 deleted the UnitTestingCleanup branch April 29, 2025 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants